mobileGetLocationHistory
Type
function
Summary
Get the mobile location samples since the last call to mobileGetLocationHistory
Syntax
mobileGetLocationHistory()
Description
System locationChanged events may occur more frequently than the locationChanged message is sent because messages that were unable to be sent as a result of other scripts executing are filtered when a new system locationChanged event occurs.
Whenever a system locationChanged event occurs, the location reading is pushed onto the front of a list. The list is capped at the length set by mobileSetLocationHistoryLimit, dropping any old samples over this length.
The best way to use the history is to fetch the list in locationChanged and process each sample in turn, rather than the sample provided with the locationChanged event (which will always be the last sample in the history). e.g.
on locationChanged
local tHistory
put mobileGetLocationHistory() into tHistory
repeat for each element tSample in tHistory
processLocationChanged tSample
end repeat
end locationChanged
Examples
local tHistory
put mobileGetLocationHistory() into tHistory
Related
command: mobileSetLocationHistoryLimit, mobileStopTrackingSensor, mobileStartTrackingSensor
function: mobileGetLocationHistoryLimit, mobileSensorAvailable, mobileSensorReading, mobileLocationAuthorizationStatus
message: locationChanged, trackingError
Compatibility and Support
Introduced
LiveCode 8.1
OS
ios
android
Platforms
mobile